package main

import (
	"fmt"
)

func isPalindrome(x int) bool {
	if 0<x && x<10{
		return true
	}
	if x < 0{
		return false
	}
	revertedNumber := 0
	for (x > revertedNumber) {
		revertedNumber = revertedNumber * 10 + x % 10
		x /= 10
	}
	fmt.Println(x, revertedNumber)
	return x == revertedNumber || x == revertedNumber / 10

}

func main() {
	fmt.Println(isPalindrome(12121))
}